package com.igeek.config.way1;

import org.springframework.stereotype.Component;

/**
 * TODO
 *
 * @author chh
 * @since 2024/5/20
 *
 * Component会将当前的类注入到IOC容器中进行管理,遵循命名策略: 类名首字母小写作为bean的唯一标识,就是id
 * 也可以通过@Component(value = "xxx")指定id
 *
 **/
@Component()
public class Student {
    private String name;
    private int age;

    public void setName(String name) {
        this.name = name;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public int getAge() {
        return age;
    }

//    @Override
//    public String toString() {
//        return "Student{" +
//                "name='" + name + '\'' +
//                ", age=" + age +
//                '}';
//    }
}
